#include<iostream>
#include<vector>
#include<string>
#include<list>

using namespace std;
int arr[100];
void slove()
{
	int n;
	cin >> n;

	int res = 1;
	int flag = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
		if (arr[i] == 0)
		{
			flag = 1;
		}
	}
	int tmp = flag;
	if (flag)
	{
		for (int i = 0; i < n; i++)
		{
			if (tmp != 0 && arr[i] == 0)
			{
				arr[i] += 1;
				tmp = 0;
			}

			res *= arr[i];
		}
	}
	else
	{
		int min = arr[0];
		int mini = 0;
		for (int i = 0; i < n; i++)
		{
			if (min > arr[i])
			{
				min = arr[i];
				mini = i;
			}
		}
		arr[mini] += 1;
		for (int i = 0; i < n; i++)
		{
			res *= arr[i];
		}
	}

	cout << res << endl;
	res = 1;
}
int main()
{
	int t;
	cin >> t;

	while (t--)
	{
		slove();
	}
	return 0;
}